package org.oslims.domain;

import java.util.Date;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.google.gwt.validation.client.NotNull;

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "PARAMETER_TYPE", discriminatorType = DiscriminatorType.STRING)
public abstract class ParameterResult extends AbstractBaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -973388480706391589L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@ManyToOne
	@JoinColumn(name = "PARAMETER_FK")
	@NotNull
	private Parameter parameter;

	@Temporal(TemporalType.TIMESTAMP)
	private Date measuredAt;

	@ManyToOne
	@JoinColumn(name = "MEASURED_BY_FK")
	private Operator measuredBy;

	@Temporal(TemporalType.TIMESTAMP)
	private Date labValAt;

	@ManyToOne
	@JoinColumn(name = "LABVAL_BY_FK")
	private Operator labValBy;

	@Temporal(TemporalType.TIMESTAMP)
	private Date scientValAt;

	@ManyToOne
	@JoinColumn(name = "SCIENTVAL_BY_FK")
	private LabStaff scientValBy;

	@NotNull
	private String state;

	@ManyToOne
	@JoinColumn(name = "ANALYSIS_RESULT_FK")
	@NotNull
	private AnalysisResult analysisResult;

	private String comment;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Parameter getParameter() {
		return parameter;
	}

	public void setParameter(Parameter parameter) {
		this.parameter = parameter;
	}

	public Date getMeasuredAt() {
		return measuredAt;
	}

	public void setMeasuredAt(Date measuredAt) {
		this.measuredAt = measuredAt;
	}

	public Operator getMeasuredBy() {
		return measuredBy;
	}

	public void setMeasuredBy(Operator measuredBy) {
		this.measuredBy = measuredBy;
	}

	public Date getLabValAt() {
		return labValAt;
	}

	public void setLabValAt(Date labValAt) {
		this.labValAt = labValAt;
	}

	public Operator getLabValBy() {
		return labValBy;
	}

	public void setLabValBy(Operator labValBy) {
		this.labValBy = labValBy;
	}

	public Date getScientValAt() {
		return scientValAt;
	}

	public void setScientValAt(Date scientValAt) {
		this.scientValAt = scientValAt;
	}

	public LabStaff getScientValBy() {
		return scientValBy;
	}

	public void setScientValBy(LabStaff scientValBy) {
		this.scientValBy = scientValBy;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public void setAnalysisResult(AnalysisResult analysisResult) {
		this.analysisResult = analysisResult;
	}

	public AnalysisResult getAnalysisResult() {
		return analysisResult;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getComment() {
		return comment;
	}
}
